package com.aioz.controller;


import com.aioz.common.Result;
import com.aioz.service.impl.PurchaseServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Aioz
 * @since 2022-11-19
 */
@RestController
@RequestMapping("/order")
public class PurchaseController {

    @Resource
    private PurchaseServiceImpl purchaseService;

    // 下单
    @PostMapping("/place/{userId}/{goodsId}")
    public Result placeAnOrder(@PathVariable Integer userId,
                               @PathVariable Integer goodsId) throws InterruptedException {
        return purchaseService.placeAnOrder(userId,goodsId);
    }
}
